﻿namespace JxcLite.Pages.BaseData;

/// <summary>
/// 商品信息列表页面。
/// </summary>
[StreamRendering]
[Route("/bds/goods")]
public class GoodsList : BaseTablePage<JxGoods>
{
    private IBaseDataService Service;

    protected override async Task OnInitPageAsync()
    {
        await base.OnInitPageAsync();
        Service = await CreateServiceAsync<IBaseDataService>();
        Table.OnQuery = Service.QueryGoodsesAsync;
    }

    public void New() => Table.NewForm(Service.SaveGoodsAsync, new JxGoods());
    public void DeleteM() => Table.DeleteM(Service.DeleteGoodsesAsync);
    public void Edit(JxGoods row) => Table.EditForm(Service.SaveGoodsAsync, row);
    public void Delete(JxGoods row) => Table.Delete(Service.DeleteGoodsesAsync, row);
    public async void Import() => await Table.ShowImportAsync();
    public async void Export() => await Table.ExportDataAsync();
}